var H5ComponentBar = function (name, cfg) {
    var component = new H5ComponentBase(name, cfg);
    $.each(cfg.data, function (idx, item) {
        console.log(item);
        let line = $('<div class="line">')
        let name = $('<div class="name">');
        let rate = $('<div class="rate">');
        let per = $('<div class="per">');
        let width = item[1] * 100 + '%';
        var bgStyle='';
        if(item[2]){
            var bgStyle = 'style="background-color:' + item[2] + '"';
        }
        rate.html('<div class="bg" '+bgStyle+'>')
        rate.css('width', width);
        name.text(item[0])
        per.text(width);
        line.append(name).append(rate).append(per);
        component.append(line);
    });

    return component;
}